home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
mail.altrad.com
/
2015.02.mail.altrad.com.tar
/
mail.altrad.com
/
TEST
/
office deutch
/
INFOPATH.NL-NL
/
INFLR.CAB
/
STATRPT.XSN_1043
/
agg.xsl
next >
Wrap
Extensible Markup Language
|
2006-11-12
|
4KB
|
97 lines
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:agg="http://schemas.microsoft.com/office/infopath/2003/aggregation"
xmlns:target="http://schemas.microsoft.com/office/infopath/2003/aggregation-target"
xmlns:sr="http://schemas.microsoft.com/office/infopath/2003/sample/StatusReport">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:variable name="target" select="target:get-documentElement()"/>
<xsl:variable name="fullName" select="normalize-space(/sr:statusReport/sr:employee/sr:name/sr:singleName)"/>
<xsl:variable name="fullNameWithBrackets">
<xsl:if test="$fullName!=''">[<xsl:value-of select="$fullName"/>]</xsl:if>
</xsl:variable>
<xsl:template match="text()"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/sr:statusReport">
<sr:statusReport
xmlns:agg="http://schemas.microsoft.com/office/infopath/2003/aggregation"
xmlns:target="http://schemas.microsoft.com/office/infopath/2003/aggregation-target"
xmlns:sr="http://schemas.microsoft.com/office/infopath/2003/sample/StatusReport">
<xsl:apply-templates select="sr:summary"/>
<xsl:apply-templates select="sr:lastPeriod"/>
<xsl:apply-templates select="sr:thisPeriod"/>
<xsl:apply-templates select="sr:issues"/>
<xsl:apply-templates select="sr:notes"/>
<xsl:apply-templates select="sr:timeReport"/>
<xsl:apply-templates select="sr:budgetReport"/>
<xsl:apply-templates select="sr:taskList"/>
</sr:statusReport>
</xsl:template>
<xsl:template match="sr:item/sr:description">
<xsl:copy>
<xsl:if test="$fullName!=''">
<xsl:value-of select="$fullNameWithBrackets"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="sr:lastPeriod/sr:item|sr:thisPeriod/sr:item|sr:issues/sr:item">
<xsl:if test="normalize-space(.)!=''">
<xsl:copy>
<xsl:if test="$fullName!=''">
<xsl:value-of select="$fullNameWithBrackets"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="/sr:statusReport/sr:summary">
<xsl:call-template name="replace-rich-text-node">
<xsl:with-param name="original-node" select="$target/sr:summary"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="/sr:statusReport/sr:notes">
<xsl:call-template name="replace-rich-text-node">
<xsl:with-param name="original-node" select="$target/sr:notes"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="replace-rich-text-node">
<xsl:param name="original-node"/>
<xsl:if test="normalize-space(.)!=''">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:attribute name="agg:action">replace</xsl:attribute>
<xsl:copy-of select="$original-node/node()"/>
<xsl:if test="$fullName!=''">
<div xmlns="http://www.w3.org/1999/xhtml">
<strong>
<xsl:value-of select="$fullName"/>
<xsl:text>:</xsl:text>
</strong>
</div>
</xsl:if>
<blockquote xmlns="http://www.w3.org/1999/xhtml" dir="ltr" style="MARGIN-TOP:0px; MARGIN-BOTTOM:0px; MARGIN-RIGHT:0px">
<xsl:copy-of select="node()"/>
</blockquote>
</xsl:copy>
</xsl:if>
</xsl:template>
</xsl:stylesheet>